package com.tvunetworks.device.extra.service;

import com.tvunetworks.center.common.model.LoginUser;
import com.tvunetworks.center.common.model.User;

/**
 * @author Etan Yang
 * @create: 2021/11/19 16:48
 */

public interface UserService {


    /**
     * get loginUser message by userId from CC User Service
     * @param userId userId
     * @return loginUser if this user is not exist in CC Service, return null
     */
    LoginUser getLoginUserByUserIdFromCcUserService(String userId);


    /**
     * get User message by userId from userGroup Service
     * @param userId userId
     * @param existFlag true:user not exist in userGroup Service, return error, false:user not exist in userGroup Service,return null
     * @return return user message
     */
    User getUserByUserIdFromUserGroup(String userId, boolean existFlag);

    /**
     * User must be exist in userGroup Service. And CC Service is not exist. create loginUser to CC Service.
     * @param userId userId come from UserGroup Service
     * @param email user email come from UserGroup Service
     */
    void createLoginUserByUserIdAndEmail(String userId, String email);
}
